<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import Hello from './Hello/index.vue'
import Read from './Read/index.vue'
import Write from './Write/index.vue'
import Webhook from './Webhook/index.vue'

const route = ref('')
const enterAction = ref({})

onMounted(() => {
  if( window.utools == undefined){
    route.value = "webhook"
  } else {
    window.utools.onPluginEnter((action) => {
      route.value = action.code
      enterAction.value = action
    })
    window.utools.onPluginOut((isKill) => {
      route.value = ''
    })
  }
})
</script>

<template>
  <template v-if="route === 'webhook'">
    <Webhook :enterAction="enterAction"></Webhook>
  </template>
</template>
